import React from 'react'
import { fans } from '../../api/mp3'
import '../../styles/myfriends/attention.css'

class Fans extends React.Component {
    constructor() {
        super()
        this.state = {
            followeds: []
        }
    }

    componentDidMount() {
        let id = localStorage.getItem('token')
        fans(id).then(res => {
            // console.log(res.data.followeds)
            let followeds = res.data.followeds
            this.setState({ followeds: followeds })
        })
    }

    render() {
        let { followeds } = this.state
        console.log(followeds[0])
        return (
            <div>
                <ul>
                    {followeds.map((item, i) => {
                        return (
                            <li key={i} className='atte-box clearfix'>
                                <img src={item.avatarUrl} alt="" />
                                <div className='atte-box-title atte-fans'>
                                    <p>{item.nickname}</p>
                                </div>
                            </li>
                        )
                    })}
                </ul>
            </div>
        )
    }
}

export default Fans